using System.Linq;
using Ornament.MemberShip.Permissions;

namespace Ornament.MemberShip
{
    public interface IMemberShipFactory
    {
        IQueryable<User> Users { get; }
        /// <summary>
        /// 
        /// </summary>
        IQueryable<Role> Roles { get; }
        /// <summary>
        /// 
        /// </summary>
        IQueryable<UserGroup> UserGroups { get; }


        //IQueryable<Profile> Profiles { get; }

        IQueryable<Permission> Permissions { get; }

        //IQueryable<ResourceInfo> Resources { get; }

        //IQueryable<T> GetResources<T>() where T : ResourceInfo;


        /// <summary>
        /// 
        /// </summary>
        IUserDao CreateUserDao();
        /// <summary>
        /// /
        /// </summary>
        /// <param name="useGlobalConnection"></param>
        /// <returns></returns>
        IUserDao CreateUserDao(bool useGlobalConnection);

        /// <summary>
        /// 
        /// </summary>
        IUserGroupDao CreateUserGroupDao();


        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IRoleDao CreateRoleDao();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IMemberDao CreateMemberDao();
      
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IPermissionDao CreatePermissionDao();

        IPermissionDao PermissionDao(bool useGlobalConnection);
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IResourceDao CreateResourceDao();
    }
}